package Day17;

import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改

public class Main5 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int year = 2022;
        int[] mounth = {0,31,28,31,30,31,30,31,31,30,31,30,31};
        int count = 0;
        for(int i = 1; i <= 12; i++){
            for(int j = 1; j <= mounth[i]; j++){
                String s = "" + year + (i < 10 ? "0" + i : i) + (j < 10 ? "0" + j : j);
                char[] c = s.toCharArray();
                int n = c.length;
                if((c[n-1] - 1 == c[n - 2] && c[n - 2] - 1 == c[n - 3]) || (c[n - 2] - 1 == c[n - 3] && c[n - 3] - 1 == c[n - 4])){
                    count++;
                }
            }
        }
        System.out.println(count);
        scan.close();
    }
}